<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>图片压缩工具</title>
    <link rel="stylesheet" href="styles.css">
</head>
<body>
    <div class="container">
        <h1>图片压缩工具</h1>
        
        <div class="upload-container" id="dropZone">
            <svg class="upload-icon" viewBox="0 0 24 24" width="64" height="64">
                <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" fill="#666"/>
            </svg>
            <p>拖拽图片到这里或点击上传</p>
            <input type="file" id="fileInput" accept="image/*" multiple hidden>
            <div class="upload-tips">最多可同时添加20张图片</div>
        </div>

        <div class="images-list" id="imagesList" style="display: none;">
            <h3>待处理图片列表</h3>
            <div class="images-grid" id="imagesGrid"></div>
        </div>

        <div class="preview-container" id="previewContainer" style="display: none;">
            <div class="preview-box">
                <h3>原图</h3>
                <img id="originalPreview">
                <div class="image-info" id="originalInfo"></div>
            </div>
            
            <div class="preview-box">
                <h3>压缩后</h3>
                <img id="compressedPreview">
                <div class="image-info" id="compressedInfo"></div>
            </div>
        </div>

        <div class="controls" id="controls" style="display: none;">
            <div class="quality-control">
                <label for="quality">压缩质量：</label>
                <input type="range" id="quality" min="0" max="100" value="80">
                <span id="qualityValue">80%</span>
            </div>
            <button id="downloadBtn" class="download-btn">下载压缩图片</button>
        </div>
    </div>
    <script src="script.js"></script>
</body>
</html> 